<%@ page import="org.opencms.jsp.CmsJspActionElement,
com.dcampus.contentmodels.CmsTemplateResolver,
org.opencms.file.CmsResource,
org.opencms.jsp.CmsJspNavElement,
org.opencms.file.*,
org.opencms.file.types.*,
java.util.*"%><%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %><% 
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
CmsTemplateResolver.initPageContextAttribute(cms);
String uri = cms.getRequestContext().getUri();
%><ul class="menu">
<li><a href="<cms:link>${__SITE_FOLDER__}index.html</cms:link>">首页</a></li>
<%
String site = CmsTemplateResolver.getSite(uri);
List list = cms.getNavigation().getNavigationForFolder(site);
Iterator i = list.iterator();

while (i.hasNext()){
	CmsJspNavElement ne = (CmsJspNavElement)i.next();
	
	out.print("<li");
	boolean newwin = "true".equalsIgnoreCase(ne.getProperty(CmsPropertyDefinition.PROPERTY_NAVNEWWIN));
	String newslink = cms.link(ne.getResourceName());
	uri = cms.link(uri);
	
	if(uri != null && uri.startsWith(newslink))
		out.print(" class=\"li_active1\"");
	
	List list2 = cms.getNavigation().getNavigationForFolder(ne.getResourceName());

	if(list2.size() > 0)
		out.print("><a  href=\""+ newslink +"\"");
	else
		out.print("><a  href=\""+ newslink +"\"");
	out.print(newwin ? " target=\"_blank\"":" ");
	out.print(" >");
	String text = ne.getProperty(CmsPropertyDefinition.PROPERTY_NAVTEXT);
	if(text == null || "".equals(text.trim())){
	text = ne.getProperty(CmsPropertyDefinition.PROPERTY_TITLE);
	}
	if(text == null){
	text = ne.getFileName();
	}else{
	text = text.trim();
	}
	out.print(text + "</a>");

	Iterator i2 = list2.iterator();
    	if(list2.size() > 0){
    		out.print("<ul class=\"ul2\">");
	    	while (i2.hasNext()){
	    		CmsJspNavElement ne2 = (CmsJspNavElement)i2.next();
	    		boolean newwin2 = "true".equalsIgnoreCase(ne2.getProperty(CmsPropertyDefinition.PROPERTY_NAVNEWWIN));
			String newslink2 = cms.link(ne2.getResourceName());
	    		out.print("<li ");
	    		
			if(uri != null && uri.startsWith(newslink2))
				out.print(" class=\"li_active2\"");
				
			out.print("><a  href=\""+  newslink2  +"\"");
	    		out.print(newwin2 ? " target=\"_blank\"":"");
			out.print(" >");
			
	    		String text2 = ne2.getProperty(CmsPropertyDefinition.PROPERTY_NAVTEXT);
			if(text2 == null || "".equals(text2.trim())){
			text2 = ne2.getProperty(CmsPropertyDefinition.PROPERTY_TITLE);
			}
			if(text2 == null){
			text2 = ne2.getFileName();
			}else{
			text2 = text2.trim();
			}
			out.print(text2 + "</a><span></span></li>");
	    	
	    	}
	    	out.print("</ul>");
	}
	out.print("</li>");
}
out.print("</ul>");
%>